Skip to content

Measure parallel encodes over the whole curve - #13

Merged
geeooff merged 1 commit into
mainfrom
fix/parallel-measurement
Nov 23, 2026
Merged

geeooff merged 1 commit into
mainfrom
fix/parallel-measurement

Conversation

@geeooff

@geeooff geeooff commented Nov 23, 2026

Copy link
Copy Markdown
Owner

What

hardware::measure_parallel_encodes now always runs 1 to 4 concurrent encodes. engines_from_throughput takes the fewest encodes that reach 85 % of the best total. Before, the measurement stopped at the first step that added less than half of one encode.

Why

The NVIDIA driver chooses which NVENC engine each session runs on. On the RTX 4090, with the same driver (621.24), two runs of hevc_nvenc p7 on a synthetic 1080p60 picture gave these totals:

Date 1 encode 2 at once 3 at once Old rule New rule
2026-11-20 146 fps 289 fps 302 fps 2 2
2026-11-23 147 fps 205 fps 295 fps 1 3

In the second run, the first two sessions shared one engine; the second engine only started with the third. That second curve was reproduced with FFmpeg alone, outside the app. The old rule never tried 3. 85 % rather than 90 %: 90 % classified the 2026-11-20 curve as 3.

The measurement now takes about 12 s instead of about 7 s, once per GPU, driver and encoder. A manual Encodes at once value is still never overwritten.

Checked

  • .\scripts\build.ps1 passes. The unit test covers both 4090 curves, one shared engine, three engines and a session limit.
  • docs/architecture.md and CHANGELOG.md (Fixed) are updated.
  • Not checked: a real RTX 3080 (single engine), which should still get 1.

This PR will conflict with #12 in CHANGELOG.md (both add to [Unreleased]); whichever merges second is rebased.

🤖 Generated with Claude Code

The NVIDIA driver can put the first two encode sessions on one NVENC engine and start the second engine only with a third: an RTX 4090 measured 147, 205, 295 frames/s for 1 to 3 encodes (reproduced with FFmpeg alone), which the stop-at-the-first-small-step rule read as 1 engine. The measurement now always runs 1 to 4 encodes and takes the fewest reaching 85 % of the best total (2 for the earlier 399/789/852/881 curve, 3 for the new one).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@geeooff
geeooff enabled auto-merge November 23, 2026 20:25
@geeooff
geeooff merged commit ca46043 into main Nov 23, 2026
2 checks passed
@geeooff
geeooff deleted the fix/parallel-measurement branch November 23, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant